package com.example.springboot.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 一级路由表
 * </p>
 *
 * @author he
 * @since 2023-11-16
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("submenu")
@Schema(name = "SubmenuEntity", description = "$!{table.comment}")
public class SubmenuEntity extends Model<SubmenuEntity> {

    @Schema(description = "序号")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "名称")
    @TableField("label")
    private String label;

    @Schema(description = "图标")
    @TableField("icon")
    private String icon;

    @Schema(description = "状态")
    @TableField("state")
    private Integer state;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间")
    @TableField("createTime")
    private Date createTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "更新时间")
    @TableField("updateTime")
    private Date updateTime;

    @Override
    public Serializable pkVal() {
        return this.id;
    }
}
